#include "hce_serial_cmd.h"
#include "..\hal\serial_console\hal_serial_console.h"

static void Printf_dbg_Help(void)
{
    DBG_MSG("\r\n");
    DBG_MSG("============ dbg cmd ============\r\n");
    DBG_MSG("1>. dbg on\r\n");
    DBG_MSG("2>. dbg off\r\n");
    DBG_MSG("=================================\r\n");
}

static void reset_func(void *arg)
{
		arg = arg;
    Sys_Soft_Reset();
    return;
}

static void cmd_func(void *arg)
{
    int argc = 0;
    char *argv[MAX_ARGC] = {0};
    argc = hal_console_parse_param(arg, argv);
    if (argc == 1)
    {
        DBG_INFO("less argc");
        return;
    }
    if(strcmp(argv[1], "on") == 0)
    {
        console_dev.debug_flag = ON;
    }
    else if(strcmp(argv[1], "off") == 0)
    {
        console_dev.debug_flag = OFF;
    }
    else
    {
        Printf_dbg_Help();
    }
}


struct _hal_serial_str_cmp usmart_nametab[] =
{
    { "reset",          reset_func },
    { "dbg",            cmd_func },
};

uint16_t hce_adapter_num(void)
{
	return sizeof(usmart_nametab)/sizeof(usmart_nametab[0]);
}

